#include "EPSG/LightSource.h"

/* EPSG Includes */
#include "EPSG/LightManager.h"

/* System Includes */
#ifdef WIN32
	#include <Windows.h>
#endif

/* OpenGL Includes */
#include <GL/GL.h>
#include <GL/GLU.h>

EPSG::LightSource::LightSource()
{
	_id = EPSG::LightManager::nextID();
	if( _id == 0 )
		glEnable( GL_LIGHTING );

	EPSG::LightManager::push( this );
	_enabled = true;
}

void EPSG::LightSource::setupLights()
{

}

void EPSG::LightSource::setAmbient( float r, float g, float b, float a )
{
	_amb[0] = r;
	_amb[1] = g;
	_amb[2] = b;
	_amb[3] = a;
}

void EPSG::LightSource::setDiffuse( float r, float g, float b, float a )
{
	_dif[0] = r;
	_dif[1] = g;
	_dif[2] = b;
	_dif[3] = a;
}

void EPSG::LightSource::setSpecular( float r, float g, float b, float a )
{
	_spc[0] = r;
	_spc[1] = g;
	_spc[2] = b;
	_spc[3] = a;
}

void EPSG::LightSource::enable( bool val )
{
	_enabled = val;
}